package com.example.myapplication5.ui.components

import androidx.compose.foundation.content.MediaType.Companion.Text
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Checkbox
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.myapplication5.entity.Todo

@Composable
fun TodoItem(modifier: Modifier=Modifier,todo: Todo,onCheckedChange:(Boolean)->Unit){
     Row(modifier = modifier
         .fillMaxWidth()
         .padding(horizontal = 8.dp), horizontalArrangement = Arrangement.SpaceBetween){
         Column {
             Text(text=todo.content,maxLines=2,fontSize=16.sp)
             Text(text=todo.date,maxLines=1,fontSize=12.sp)
         }
         Checkbox(checked = todo.done, onCheckedChange = onCheckedChange)
     }
}